<template>
    <ui-main title="toSQL数据转换">
        <div class="item one">
            <div class="ui message">
                数组1: {{arr}} <br> 数组2: {{arr2}} <br> 数组3: {{arr3}} <br>
            </div>
            <table class="ui very basic collapsing celled table">
                <thead>
                <tr>
                    <th width="30%">方法</th>
                    <th>结果</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>
                        <strong>转id</strong> $bui.toSQL(arr)
                    </td>
                    <td>
                        {{$bui.toSQL(arr)}}
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>转name</strong> $bui.toSQL(arr,'name','|')
                    </td>
                    <td>
                        {{$bui.toSQL(arr,'name','|')}}
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>转数字</strong> $bui.toSQL(arr2)
                    </td>
                    <td>
                        {{$bui.toSQL(arr2)}}
                    </td>
                </tr>
                <tr>
                    <td>
                        <strong>转字符串</strong> $bui.toSQL(arr3, ' 😂 ')
                    </td>
                    <td>
                        {{$bui.toSQL(arr3, ' 😂 ')}}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="item two">
            <ui-load-md file="toSQL.md"></ui-load-md>
        </div>
    </ui-main>
</template>
<script>
export default {
    data(){
        return {
            arr:[
                {
                    id:'id-001',
                    name:'懂秘'
                },
                {
                    id:'id-002',
                    name:'荥阳'
                },
                {
                    id:'id-003',
                    name:'野味'
                }
            ],
            arr2:[1,2,3],
            arr3:['a','b','c']
        }
    },
}
</script>
